{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 《Python数据分析基础》\n",
    "### 【第3章 Python编程分析基础】数据与练习3 \n",
    "#### **（请在#下面问题的空白处写出代码并输出结果）**"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.1 下面有三组数据：\n",
    "\n",
    "    1, 2, 3, 4, 5 \n",
    "    a, b, c, d\n",
    "    physics, chemistry, 1997, 2000"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#（1）将其写入列表中。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#（2）将其写入字典中。\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.2 请创建下列Python数组，并计算。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#（1）创建一个2*2的数组，计算对角线上元素的和。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#（2）创建一个长度为9的一维数据，数组元素0～8，并将它重新变为3*3的二维数组。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#（3）创建两个3*3的数组，分别将它们合并为3*6、6*3的数组后，拆分为3个数组。\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.3 文本数据。下面有一些文本数据：\n",
    "\n",
    "       name,physics,Python,math,english\n",
    "       Google,100,100,25,12\n",
    "       Facebook,45,54,44,88\n",
    "       Twitter,54,76,13,91\n",
    "       Yahoo,54,452,26,100"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#（1）请将其写入列表。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#（2）请将其写入字典。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#（3）请将其写入数据框。\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#（4）请将其保存到csv格式的文档，并从read_csv函数读入Python。\n",
    "    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.4 调查数据。某公司对财务部门人员的抽烟状态进行调查，结果为：\n",
    "\n",
    "    否，否，否，是，是，否，否，是，否，是，否，否，是，是，否，是，否，否，是，是。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#（1）请用列表录入该数据。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#（2）请将这组数据输入电子表格，并将其读入Python。\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.5 对第1章建立的电子表格mydata1.xlsx数据，"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#（1）将上面的4组数据写入其中的表单。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#（2）分别用Python 的read_csv和read_excel函数读取。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#（3）对其中的学生数据，用Python方法获取性别、数学成绩和统计成绩变量，并筛选不同性别学生的成绩。\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
